//
//  MSAreaPickerView.h
//  MuRenHe
//
//  Created by mls on 2021/5/17.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface MSAreaModel : NSObject

@property (nonatomic, copy)     NSString                *Id;
@property (nonatomic, copy)     NSString                *name;
@property (nonatomic, strong)   NSArray<MSAreaModel *>  *children;

@end

@protocol MSAreaPickerViewDelegate;
@protocol MSAreaPickerViewDataSource;
@interface MSAreaPickerView : UIView

@property (nonatomic, weak) id<MSAreaPickerViewDelegate>    delegate;
@property (nonatomic, weak) id<MSAreaPickerViewDataSource>  dataSource;
/** 刷新数据 */
- (void)ms_reloadData;

@end

@protocol MSAreaPickerViewDelegate <NSObject>

@optional
/** 完成 */
- (void)ms_areaPickerViewDidComplete:(nonnull MSAreaPickerView *)view
                            province:(nonnull MSAreaModel *)province
                                city:(nonnull MSAreaModel *)city
                                area:(nonnull MSAreaModel *)area;
/** 取消 */
- (void)ms_areaPcikerViewDidCancel:(nonnull MSAreaPickerView *)view;

@end

@protocol MSAreaPickerViewDataSource <NSObject>

@optional
/** 默认省id */
- (NSString *)ms_defaultProvinceIdInAreaPickerView:(nonnull MSAreaPickerView *)view;
/** 默认市id */
- (NSString *)ms_defaultCityIdInAreaPickerView:(nonnull MSAreaPickerView *)view;
/** 默认区id */
- (NSString *)ms_defaultAreaIdInAreaPickerView:(nonnull MSAreaPickerView *)view;

@end

NS_ASSUME_NONNULL_END
